<?php 
	include("includes/connect.php");
	include("includes/function.php");

	$petition_id = $_REQUEST["petition_id"];

?>

<script type="text/javascript">
	$(document).ready(function(){

		$("#save_menus").click(function() {
			event.preventDefault();

			var reason = $("#reason").val();
			var petition_id = $("#petition_id").val();
			var task = "cancel";
			//alert(petition_id);
			$.ajax({
				type: "POST",
				url: "processPetition.php",
				data: { 'task': task, 'reason': reason, 'petition_id': petition_id },
				cach: false,
				error: function() {
					alert("ERROR !!!!");
				},
				success: function(data){
					//if(data) { $("#kob").html(data); }
					window.location.href="index.php?pages=finance";
				}
			});

		});
	});
</script>

<p>
    <label>เหตุผล</label>
	<textarea class="input-block-level" rows="7" name="reason" id="reason"></textarea>
    <input type="hidden" name="petition_id" id="petition_id" value="<?php echo $petition_id; ?>">
</p>
<div class="form-actions">
	<button class="btn btn-primary" id="save_menus">Save changes</button>
	<button class="btn close-dialog"><i class="icon-remove"></i> ยกเลิก</button>

</div>
